package com.zsrt.oa.vip.controller;

import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.zsrt.oa.vip.service.VipService;
import com.zsrt.oa.vip.service.impl.VipServiceImpl;
import com.zsrt.utils.DBUtils;

/**
 * 会员信息的控制层
 * @author 罗智壕-13424431416
 *
 * 2017年6月11日
 */
public class VipController extends HttpServlet {
	private static final long serialVersionUID = 1L;
	
	/**
	 * 初始化会员服务层
	 */
	private VipService service = new VipServiceImpl();
	
	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response) 
			throws ServletException, IOException {
		
		String method = request.getParameter("method");
		if(null != method && !"".equals(method.trim())){
			Map<String,Object> map = new HashMap<String,Object>();
			
			if("query".equals(method)){
				
				service.queryAllMessage(map);
			}
			
			DBUtils.toJson(map, response);
		}
	}
}
